<template>
  <div class="common-layout">
    <el-row>
      <el-col :span="24"
        ><div class="grid-content ep-bg-purple-dark" />
        <div class="App_header">
          <div class="header_left">
            <img src="@/static/info.jpg" alt="" />
            知恩の小宝贝
          </div>
          <el-button type="info" class="header_out" @click="logout"
            >退出</el-button
          >
        </div>
      </el-col>
    </el-row>
    <el-container>
      <el-aside width="200px">
        <!-- 组左边菜单栏 -->
        <home-left
          :isCollapse="isCollapse"
          :changeIsCollapse="changeIsCollapse"
        ></home-left>
      </el-aside>
      <el-container>
        <!-- 顶部收缩栏 -->
        <el-header> 面包屑 </el-header>

        <el-main>
          <div class="App_main">
            <router-view />
          </div>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script setup lang="ts">
import HomeLeft from "@/components/AppLeft.vue";
import { CaretRight } from "@element-plus/icons-vue";
import { onMounted, ref } from "vue";
import { useRouter } from "vue-router";
const router = useRouter();
// 退出登录
const logout = () => {
  sessionStorage.removeItem("token");
  router.push("/login");
};

// 收缩展开
const isCollapse = ref(false);
const changeIsCollapse = () => {
  isCollapse.value = !isCollapse.value;
};
</script>
<style lang="scss" scoped></style>
<style lang="scss">
@import "@/style/main.scss";
html,
body,
#app,
.el-container {
  height: 100%;
  width: 100%;
}
.el-aside,
.el-container,
.common-layout,
#app,
body,
html {
  height: 100%;
}
.el-main {
  border: 1px solid #eaedf1;
  background-color: #eaedf1;
  border-top: none;
  overflow-x: hidden;
  padding: 20px;
  .App_main {
    background-color: #fff;
    padding: 20px;
    min-width: 800px;
  }
}
.el-header {
  border: 1px solid #eaedf1;
  background-color: #eaedf1;
  border-bottom: none;
}
table {
  border-collapse: collapse;
  margin: 0 auto;
  text-align: center;
}
table td,
table th {
  border: 1px solid #cad9ea;
  color: #666;
  height: 30px;
}
table thead th {
  background-color: #cce8eb;
  width: 100px;
}
table tr:nth-child(odd) {
  background: #fff;
}
table tr:nth-child(even) {
  background: #f5fafa;
}
.App_header {
  height: 50px;
  width: 100%;
  background-color: #373d41;
  padding: 0 50px 0;
  display: flex;
  box-sizing: border-box;
  justify-content: space-between;
  align-items: center;
  .header_left {
    font-size: 22px;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    img {
      border-radius: 50px;
      margin-right: 10px;
      width: 40px;
      height: 40px;
    }
  }
  .header_out {
    background-color: #46484c;
    border: none;
  }
}
</style>
